<!DOCTYPE html>
<html>
    <head>
        <title>SSE 客户端</title>
    </head>
    <body>
        <h1>SSE Example</h1>
        <div id="sse-data"></div>
        <script>
            const eventSource = new EventSource('http://localhost:8000/events');
            eventSource.onmessage = function(event) {
                const dataDiv = document.getElementById('sse-data');
                dataDiv.innerHTML = 'Received message: ' + event.data;
            };
        </script>
    </body>
</html>